<template>
  <div
    @click="btnClick"
    class="confirmButton-container"
  >
    <div
      class="confirm"
      :class="{'changeopacity':opacity,'changewidth':width}"
    >{{content}}</div>

  </div>
</template>

<script>
export default {
  name: "confirmButton",
  components: {},
  props: {
    width: {
      type: String,
      required: false
    },
    opacity: {
      type: Boolean,
      required: false
    },
    content: {
      type: String,
      required: true
    }
  },
  name: "confirmButton",
  data() {
    return {};
  },
  methods: {
    btnClick() {
      this.$emit("btnclick");
    }
  },
  watch: {
    opacity(newValue, oldValue) {
      console.log(oldValue);
      this.opacity = newValue;
      console.log(this.opacity);
    }
  }
};
</script>

<style lang="less">
.confirmButton-container {
  width: 100%;
  height: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  // opacity: .44;

  .confirm {
    position: absolute;
    width: 6.9rem;
    height: 0.88rem;
    background: rgba(126, 86, 198, 1);
    border-radius: 0.39rem;
    z-index: 100;
    text-align: center;
    font-size: 0.36rem;
    font-family: PingFang-SC-Medium;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    line-height: 0.88rem;
  }

  .changewidth {
    width: 5rem !important;
  }
  .changeopacity {
    opacity: 0.44 !important;
  }
}
</style>
